import Vue from 'vue'
import Router from 'vue-router'

// common
import Demo from '@pages/Demo'
import Slide from '@pages/Slide'
import Sign from '@pages/Sign'
import Forget from '@pages/Forget'
import Index from '@pages/Index'

// 首页
import Home from '@pages/Home'

// 消息
import News from '@pages/News'
import Message from '@pages/News/Message'
import Notify from '@pages/News/Notify'
import MessageDetails from '@pages/News/MessageDetails'
import NotifyDetails from '@pages/News/NotifyDetails'

// 我
import Profile from '@pages/Profile'
import Contact from '@pages/Profile/Contact'
import Opinion from '@pages/Profile/Opinion'
import About from '@pages/Profile/About'
import Modify from '@pages/Profile/Modify'
import Change from '@pages/Profile/Change'

// 任务
import Task from '@pages/ActAllot/List'
import Taskfinish from '@pages/ActAllot/FinishList'
import Dlssue from '@pages/Home/dlssue/dlssue'
import Dcome from '@pages/Home/dcome/dcome'

// 申请单
import ApplyList from '@pages/ActApply/List'
import ApplyDetails from '@pages/ActApply/Details'

// 处理任务
import Audit from '@pages/ActApply/Audit'

// 收货发货详情
import DeliverDetails from '@pages/Deliver/Details'

// 设备
import Device from '@pages/Device/List'
import DeviceDetail from '@pages/Device/Details'
import Echarts from '@pages/Device/Echarts' // 设备使用率
import DeviceFilter from '@pages/Device/Filter'
import DeviceHostModle from '@pages/Device/Filter/HostModle'
import DeviceHouseModle from '@pages/Device/Filter/HouseModle'
import DeviceMaterModle from '@pages/Device/Filter/MaterModle'
import DeviceCponyModle from '@pages/Device/Filter/CponyModle'
import DevicePertyModle from '@pages/Device/Filter/PertyModle'

Vue.use(Router)

export default new Router({
  // mode: 'history',
  routes: [
    // common
    {
      path: '/demo',
      name: 'Demo',
      component: Demo,
      meta: {
        requireAuth: false
      }
    },
    {
      path: '/slide',
      name: 'Slide',
      component: Slide,
      meta: {
        requireAuth: false // 登录拦截
      }
    },
    {
      path: '/sign',
      name: 'Sign',
      component: Sign
    },
    {
      path: '/forget',
      name: 'Forget',
      component: Forget
    },
    // 首页
    {
      path: '/',
      name: 'Index',
      component: Index,
      redirect: '/slide',
      children: [
        // Home
        {
          path: '/home',
          name: 'Home',
          component: Home
        },
        // 消息
        {
          path: '/news',
          name: 'News',
          component: News
        },
        // Profile
        {
          path: '/profile',
          name: 'Profile',
          component: Profile
        }
      ]
    },
    {
      path: '/notify',
      name: 'Notify',
      component: Notify
    },
    {
      path: '/notify/:id',
      name: 'NotifyDetails',
      component: NotifyDetails
    },
    {
      path: '/message',
      name: 'Message',
      component: Message
    },
    {
      path: '/message/:id',
      name: 'MessageDetails',
      component: MessageDetails
    },
    {
      path: '/contact',
      name: 'contact',
      component: Contact
    },
    {
      path: '/opinion',
      name: 'opinion',
      component: Opinion
    },
    {
      path: '/about',
      name: 'about',
      component: About
    },
    {
      path: '/modify',
      name: 'modify',
      component: Modify
    },
    {
      path: '/change',
      name: 'change',
      component: Change
    },
    // 任务
    {
      path: '/task',
      name: 'Task',
      component: Task
    },
    {
      path: '/taskfinish',
      name: 'taskfinish',
      component: Taskfinish
    },
    {
      path: '/dlssue',
      name: 'Dlssue',
      component: Dlssue
    },
    {
      path: '/dcome',
      name: 'dcome',
      component: Dcome
    },
    // 申请单
    {
      path: '/apply',
      name: 'ApplyList',
      component: ApplyList
    },
    {
      path: '/apply/:id',
      name: 'ApplyDetails',
      component: ApplyDetails
    },
    // 处理任务
    {
      path: '/audit/:id',
      name: 'Audit',
      component: Audit
    },
    // 收货发货详情
    {
      path: '/deliver/:id',
      name: 'DeliverDetails',
      component: DeliverDetails
    },
    // 设备
    {
      path: '/device',
      name: 'Device',
      component: Device
    },
    {
      path: '/device/:id',
      name: 'DeviceDetail',
      component: DeviceDetail
    },
    {
      path: '/echarts',
      name: 'Echarts',
      component: Echarts
    },
    {
      path: '/devicefilter',
      name: 'DeviceFilter',
      component: DeviceFilter
    },
    {
      path: '/hostmodle',
      name: 'DeviceHostModle',
      component: DeviceHostModle
    },
    {
      path: '/housemodle',
      name: 'DeviceHouseModle',
      component: DeviceHouseModle
    },
    {
      path: '/matermodle',
      name: 'DeviceMaterModle',
      component: DeviceMaterModle
    },
    {
      path: '/cponymodle',
      name: 'DeviceCponyModle',
      component: DeviceCponyModle
    },
    {
      path: '/pertymodle',
      name: 'DevicePertyModle',
      component: DevicePertyModle
    }
  ]
})
